<?php

namespace common\models\hospital;

use Yii;

/**
 * This is the model class for table "{{%project_principal}}".
 *
 * @property int $id
 * @property string|null $truename 项目负责人姓名
 * @property string|null $name_sx 项目缩写
 * @property string|null $project_name 项目简称
 * @property int|null $project_id 项目id
 * @property string|null $user_id 钉钉用户id
 */
class ProjectPrincipal extends \common\models\BaseModel
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%project_principal}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db3');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['id', 'project_id'], 'integer'],
            [['truename', 'name_sx', 'project_name'], 'string', 'max' => 20],
            [['user_id'], 'string', 'max' => 255],
            [['id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'truename' => '项目负责人姓名',
            'name_sx' => '项目缩写',
            'project_name' => '项目简称',
            'project_id' => '项目id',
            'user_id' => '钉钉用户id',
        ];
    }
}
